package com.wlyuan.index.infrastructure.jobhandler;


import com.wlyuan.index.api.ICombineIndexService;
import com.wlyuan.index.api.dto.combine.CombineReindexAllDTO;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author yuanjie
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class CombineReindexAllJobHandler extends IJobHandler {
    private final ICombineIndexService combineIndexService;

    @Override
    @XxlJob("CombineReindexAllJob")
    public void execute() {
        combineIndexService.reindexAll(new CombineReindexAllDTO());
    }
}
